<template>
  <div>
    <div class="head">
      <div class="bnti">
        <!-- 太原市重点产业招商图谱平台 -->
        <img src="~@img/header/superuser-head-title.png" alt="" />
      </div>
      <div class="right">
        <div class="time">
          <img src="~@img/header/icon-date.png" alt="" />
          <span>{{ nowTime }}</span>
        </div>
        <div @click="exitLogin" class="right-btn">
          <img src="~@img/header/icon-out.png" alt />
          <span>退出登录</span>
        </div>
      </div>
    </div>
    <div class="head2"></div>
  </div>
</template>

<script>
export default {
  name: "heandtop",
  data() {
    return {
      nowTime: null,
    };
  },
  created() {},
  mounted() {
    setInterval(() => {
      this.getNowTime();
    }, 1000);
  },
  methods: {
    getNowTime() {
      this.nowTime = this.$moment().format("YYYY/MM/DD  dddd  HH:mm:ss");
    },
    exitLogin() {
      localStorage.setItem("login", "");
      // console.log(this.$store);
      this.$store.commit("setFlag", 0);
      this.$router.replace({ path: "/" });
    },
  },
};
</script>

<style lang="less" scoped>
.head2 {
  height: 100px;
}
.head {
  position: fixed;
  z-index: 1999;
  width: 100%;
  height: 100px;
  min-width: 1024px;
  background: url("~@img/header/superuser-head-bgimg.png") no-repeat;
  background-size: 100% 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  .bnti {
    // margin-left: 30px;
    // width: 230px;
    font-size: 24px;
    color: #ffffff;
    flex-wrap: nowrap;
    white-space: nowrap;
    text-align: left;
  }
  .right {
    position: absolute;
    right: 30px;
    top: 26px;
    display: flex;
    // margin-right: 30px;
    // display: flex;
    .time {
      margin-right: 30px;
      width: 280px;
      cursor: default;

      img {
        margin-right: 10px;
        width: 22px;
        height: 18px;
        vertical-align: middle;
      }
      span {
        vertical-align: middle;
        font-size: 18px;
        font-family: Microsoft YaHei;
        font-weight: 400;
        color: #ffffff;
      }
      line-height: 46px;
    }
    .right-btn {
      width: 160px;
      height: 46px;
      background: rgba(39, 110, 156, 0.36);
      box-shadow: 0px 0px 4px 0px rgba(0, 132, 255, 0.8),
        0px 0px 16px 0px rgba(0, 156, 255, 0.31);
      border-radius: 10px;
      font-size: 20px;
      font-family: Microsoft YaHei;
      font-weight: 400;
      color: #ffffff;
      line-height: 46px;
      cursor: pointer;
      img {
        margin-right: 10px;
        width: 20px;
        height: 16px;
      }
    }
  }
}
/*
  *常用电脑尺寸  1600 * 900
  *              1536 * 864
  *              1440 * 900
  *ipad pro      1366 * 1024
  *ipad mini     1024 * 768
  *ipad          1024 * 768
 */
/*分辨率低于1440，采用下面的样式*/
@media screen and (max-device-width: 1366px) {
  .head .bnti {
    img {
      width: 88% !important;
    }
  }
}
/*分辨率低于1180，采用下面的样式*/
@media screen and (max-device-width: 1180px) {
  .head .bnti {
    img {
      width: 66% !important;
    }
  }
}
/*分辨率低于1024，采用下面的样式*/
@media screen and (max-device-width: 1024px) {
  .bnti {
    img {
      width: 66% !important;
    }
  }
}
</style>
